import { DECREMENT, INCREMENT, INCREMENT_ASYNC } from '../const/conter.const'

// export const increment = (payload) => ({ type: INCREMENT, payload })
// export const decrement = (payload) => ({ type: DECREMENT, payload })

// dispatch 是中间件reture  传递过来的
// thunk
// export const increment_async = (payload) => (dispatch) => {
// 	setTimeout(() => {
// 		// 触发其他action
// 		dispatch(increment(payload))
// 	}, 2000)
// }

// export const increment_async = (payload) => ({ type: INCREMENT_ASYNC, payload })

// 使用 redux-actions

import { createAction } from 'redux-actions'

export const increment = createAction('increment')
export const decrement = createAction('decrement')
